package com.ude.pim.service.impl;

import com.ude.pim.common.R;
import com.ude.pim.entity.Sub;
import com.ude.pim.mapper.SubMapper;
import com.ude.pim.service.SubService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 子流程表	记录子流程的名称（未来可能新增子流程） 服务实现类
 * </p>
 *
 * @author yb
 * @since 2023-08-08
 */
@Service
public class SubServiceImpl extends ServiceImpl<SubMapper, Sub> implements SubService {

    @Override
    public R<String> getNameById(Integer subId) {
        Sub sub = this.getById(subId);
        if (sub == null) {
            return R.error("该子流程不存在");
        }
        return R.success(sub.getName());
    }
}
